<?php

/**
 * Empresa form base class.
 *
 * @package    isaac
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 12815 2008-11-09 10:43:58Z fabien $
 */
class BaseEmpresaForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'         => new sfWidgetFormInputHidden(),
      'cuit'       => new sfWidgetFormInput(),
      'nombre'     => new sfWidgetFormInput(),
      'telefono'   => new sfWidgetFormInput(),
      'direccion'  => new sfWidgetFormInput(),
      'localidad'  => new sfWidgetFormInput(),
      'cod_postal' => new sfWidgetFormInput(),
      'provincia'  => new sfWidgetFormInput(),
      'cta_debito' => new sfWidgetFormInput(),
      'created_at' => new sfWidgetFormDateTime(),
      'updated_at' => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'         => new sfValidatorPropelChoice(array('model' => 'Empresa', 'column' => 'id', 'required' => false)),
      'cuit'       => new sfValidatorString(array('max_length' => 11)),
      'nombre'     => new sfValidatorString(array('max_length' => 48)),
      'telefono'   => new sfValidatorString(array('max_length' => 64)),
      'direccion'  => new sfValidatorString(array('max_length' => 64)),
      'localidad'  => new sfValidatorString(array('max_length' => 24)),
      'cod_postal' => new sfValidatorString(array('max_length' => 15)),
      'provincia'  => new sfValidatorString(array('max_length' => 24, 'required' => false)),
      'cta_debito' => new sfValidatorString(array('max_length' => 24, 'required' => false)),
      'created_at' => new sfValidatorDateTime(array('required' => false)),
      'updated_at' => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->validatorSchema->setPostValidator(
      new sfValidatorPropelUnique(array('model' => 'Empresa', 'column' => array('cuit')))
    );

    $this->widgetSchema->setNameFormat('empresa[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Empresa';
  }


}
